<style lang="scss" scoped>
  .zk-col {
    margin-bottom: 10px;
  }
  .choose-cmp {
  }
</style>
<template>
  <div class="choose-cmp">
    <zk-card class="box-card" header="您绑定了多家公司，请选择一家公司继续：">
      <zk-row v-for="cmp in companys">
        <zk-col :span="20">
          {{cmp.cmpName}}
        </zk-col>
        <zk-col :span="4">
          <zk-button  v-on:click="select(cmp)">选择</zk-button>
        </zk-col>
      </zk-row>
    </zk-card>
  </div>
</template>
<script>
/**
 * @author: guocailee
 */
import * as company from 'src/api/company.js'
export default {
  name: 'chooseCompany',
  data() {
    return {
      companys: [],
      cmpId: ''
    }
  },
  methods: {
    select(cmp) {
      this.$fetch.submit('apiv1/content/chooseCompany', cmp)
    }
  },
  mounted() {
    let self = this
    company.query().then(data => {
      self.companys = data.body.payload.results
    })
  }
}
</script>